home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / contrib / pdcurs22 / include / cursos2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-26  |  7.9 KB  |  325 lines

  1. /*
  2. ***************************************************************************
  3. * This file comprises part of PDCurses. PDCurses is Public Domain software.
  4. * You may use this code for whatever purposes you desire. This software
  5. * is provided AS IS with NO WARRANTY whatsoever.
  6. * Should this software be used in another application, an acknowledgement
  7. * that PDCurses code is used would be appreciated, but is not mandatory.
  8. *
  9. * Any changes which you make to this software which may improve or enhance
  10. * it, should be forwarded to the current maintainer for the benefit of 
  11. * other users.
  12. *
  13. * The only restriction placed on this code is that no distribution of
  14. * modified PDCurses code be made under the PDCurses name, by anyone
  15. * other than the current maintainer.
  16. * See the file maintain.er for details of the current maintainer.
  17. ***************************************************************************
  18. */
  19. /* 
  20. $Id$
  21. */
  22. #ifndef CURSOS2_INCL
  23. #define CURSOS2_INCL 1
  24.  
  25. #ifdef CURSES__32BIT__
  26.  
  27. #if (NOVIO)
  28. #define KbdSetStatus Kbd32SetStatus
  29. #define KbdGetStatus Kbd32GetStatus
  30. #define KbdCharIn Kbd32CharIn
  31. #define KbdPeek   Kbd32Peek
  32. #define KbdFlushBuffer Kbd32FlushBuffer
  33.  
  34. #define VioGetMode Vio32GetMode
  35. #define VioSetMode Vio32SetMode
  36. #define VioGetCurPos Vio32GetCurPos
  37. #define VioSetCurPos Vio32SetCurPos
  38. #define VioGetCurType Vio32GetCurType
  39. #define VioSetCurType Vio32SetCurType
  40. #define VioScrollDn Vio32ScrollDn
  41. #define VioScrollUp Vio32ScrollUp
  42. #define VioGetConfig Vio32GetConfig
  43. #define VioWrtTTY Vio32WrtTTY
  44. #define VioReadCellStr Vio32ReadCellStr
  45. #define VioWrtCellStr Vio32WrtCellStr
  46. #define VioWrtNAttr Vio32WrtNAttr
  47. #endif   /*  NOVIO */
  48.  
  49. #define FARKeyword
  50.  
  51. #define CURS_INCL_VIO_KBD
  52.  
  53.  
  54. #ifdef __EMX__
  55. #  ifndef USE_OS2_H
  56. #   ifdef EMXVIDEO        /* Define to use emx dos compatible video */
  57. #    include <stdlib.h>
  58. #    include <sys/video.h>
  59. #    ifdef USE_OS2_H
  60. #     undef USE_OS2_H    /* And we can use the extra compile speed... */
  61. #    endif
  62. #   else
  63. #    define USE_OS2_H
  64. #   endif
  65. #  endif
  66. #  define APIENTRY
  67. #else
  68. #  define APIRET ULONG
  69. #endif
  70.  
  71. #else
  72.  
  73.  
  74. #   define FARKeyword far
  75. #   define APIRET USHORT
  76.  
  77. #ifdef USE_OS2_H
  78. #   define INCL_VIO
  79. #   define INCL_KBD
  80. #else
  81. #   define CURS_INCL_VIO_KBD
  82. #endif
  83.  
  84.  
  85. #endif   /* __32BIT__ */
  86.  
  87. #ifndef EMXVIDEO
  88.  
  89. /* if USE_OS2_H is defined then use the os2.h that comes with your compiler ...*/
  90.  
  91. #ifdef USE_OS2_H
  92. #  include <os2.h>
  93. #else
  94.  
  95. /* ... otherwise use these definitions */
  96.  
  97. #  include <os2def.h>
  98.  
  99. #endif
  100.  
  101. #ifdef CURS_INCL_VIO_KBD
  102.  
  103. typedef SHANDLE         HKBD;
  104. typedef HKBD    FARKeyword *   PHKBD;
  105.  
  106.  
  107. typedef SHANDLE         HVIO;
  108. typedef HVIO    FARKeyword *   PHVIO;
  109.  
  110.  
  111.  
  112. typedef struct _KBDINFO {
  113.         USHORT cb;
  114.         USHORT fsMask;
  115.         USHORT chTurnAround;
  116.         USHORT fsInterim;
  117.         USHORT fsState;
  118.         }KBDINFO;
  119. typedef KBDINFO FARKeyword *PKBDINFO;
  120.  
  121.  
  122. USHORT APIENTRY KbdSetStatus(
  123.         PKBDINFO    pkbdinfo,
  124.         HKBD        hkbd );
  125.  
  126.  
  127. USHORT APIENTRY KbdGetStatus(
  128.         PKBDINFO    pkbdinfo,
  129.         HKBD        hdbd  );
  130.  
  131.  
  132. typedef struct _KBDKEYINFO {
  133.         UCHAR    chChar;    /* ASCII character code                     */
  134.         UCHAR    chScan;    /* Scan Code                                */
  135.         UCHAR    fbStatus;
  136.         UCHAR    bNlsShift;
  137.         USHORT   fsState;
  138.         ULONG    time;
  139.         }KBDKEYINFO;
  140. typedef KBDKEYINFO FARKeyword *PKBDKEYINFO;
  141.  
  142. #define IO_WAIT     0
  143. #define IO_NOWAIT   1
  144.  
  145. USHORT APIENTRY KbdCharIn(
  146.         PKBDKEYINFO pkbci,
  147.         USHORT      fWait,      /* IO_WAIT, IO_NOWAIT     */
  148.         HKBD        hkbd);
  149.  
  150. USHORT APIENTRY KbdPeek(
  151.         PKBDKEYINFO  pkbci,
  152.         HKBD         hkbd );
  153.  
  154. USHORT APIENTRY KbdFlushBuffer(
  155.         HKBD hkbd);
  156.  
  157.  
  158. typedef struct _VIOMODEINFO {
  159.         USHORT cb;
  160.         UCHAR  fbType;
  161.         UCHAR  color;
  162.         USHORT col;     /* number of text columns                       */
  163.         USHORT row;     /* number of text rows                          */
  164.         USHORT hres;    /* horizontal resolution                        */
  165.         USHORT vres;    /* vertical resolution                          */
  166.         UCHAR  fmt_ID;
  167.         UCHAR  attrib;  /* number of attributes                         */
  168.         ULONG  buf_addr;
  169.         ULONG  buf_length;
  170.         ULONG  full_length;
  171.         ULONG  partial_length;
  172.         PCH    ext_data_addr;
  173.         } VIOMODEINFO;
  174. typedef VIOMODEINFO FARKeyword *PVIOMODEINFO;
  175.  
  176.  
  177. USHORT APIENTRY VioGetMode(
  178.         PVIOMODEINFO  pvioModeInfo,
  179.         HVIO          hvio);
  180.  
  181.  
  182. USHORT APIENTRY VioSetMode(
  183.         PVIOMODEINFO  pvioModeInfo,
  184.         HVIO          hvio);
  185.  
  186.  
  187. USHORT APIENTRY VioGetCurPos(
  188.         PUSHORT    pusRow,
  189.         PUSHORT    pusColumn,
  190.         HVIO       hvio );
  191.  
  192.  
  193. USHORT APIENTRY VioSetCurPos(
  194.         USHORT  usRow,
  195.         USHORT  usColumn,
  196.         HVIO    hvio);
  197.  
  198. typedef struct _VIOCURSORINFO {
  199.         USHORT   yStart;
  200.         USHORT   cEnd;
  201.         USHORT   cx;
  202.         USHORT   attr;   /* -1=hidden cursor, any other=normal cursor   */
  203.         } VIOCURSORINFO;
  204. typedef VIOCURSORINFO FARKeyword *PVIOCURSORINFO;
  205.  
  206.  
  207. USHORT APIENTRY VioGetCurType(
  208.        PVIOCURSORINFO pvioCursorInfo,
  209.        HVIO           hvio );
  210.  
  211.  
  212. USHORT APIENTRY VioSetCurType(
  213.         PVIOCURSORINFO pvioCursorInfo,
  214.         HVIO           hvio );
  215.  
  216. USHORT APIENTRY VioScrollDn(
  217.         USHORT  usTopRow,
  218.         USHORT  usLeftCol,
  219.         USHORT  usBotRow,
  220.         USHORT  usRightCol,
  221.         USHORT  cbLines,
  222.         PBYTE   pCell,
  223.         HVIO    hvio );
  224.  
  225.  
  226.  
  227. USHORT APIENTRY VioScrollUp(
  228.         USHORT  usTopRow,
  229.         USHORT  usLeftCol,
  230.         USHORT  usBotRow,
  231.         USHORT  usRightCol,
  232.         USHORT  cbLines,
  233.         PBYTE   pCell,
  234.         HVIO    hvio );
  235.  
  236.  
  237.    /* VIOCONFIGINFO.adapter constants */
  238.  
  239.    #define DISPLAY_MONOCHROME      0x0000
  240.    #define DISPLAY_CGA             0x0001
  241.    #define DISPLAY_EGA             0x0002
  242.    #define DISPLAY_VGA             0x0003
  243.    #define DISPLAY_8514A           0x0007
  244.  
  245.    /* VIOCONFIGINFO.display constants */
  246.  
  247.    #define MONITOR_MONOCHROME      0x0000
  248.    #define MONITOR_COLOR           0x0001
  249.    #define MONITOR_ENHANCED        0x0002
  250.    #define MONITOR_8503            0x0003
  251.    #define MONITOR_851X_COLOR      0x0004
  252.    #define MONITOR_8514            0x0009
  253.  
  254. typedef struct _VIOCONFIGINFO {
  255.         USHORT  cb;
  256.         USHORT  adapter;
  257.         USHORT  display;
  258.         ULONG   cbMemory;
  259.         USHORT  Configuration;
  260.         USHORT  VDHVersion;
  261.         USHORT  Flags;
  262.         ULONG   HWBufferSize;
  263.         ULONG   FullSaveSize;
  264.         ULONG   PartSaveSize;
  265.         USHORT  EMAdaptersOFF;
  266.         USHORT  EMDisplaysOFF;
  267.         } VIOCONFIGINFO;
  268. typedef VIOCONFIGINFO FARKeyword *PVIOCONFIGINFO;
  269.  
  270.  
  271. USHORT APIENTRY VioGetConfig(
  272.         USHORT         usConfigId,  /* Reserved (must be 0)             */
  273.         PVIOCONFIGINFO pvioin,
  274.         HVIO           hvio );
  275.  
  276. USHORT APIENTRY VioWrtTTY(
  277.         PCH     pch,
  278.         USHORT  cb,
  279.         HVIO    hvio );
  280.  
  281. USHORT APIENTRY VioReadCellStr(
  282.         PCH       pchCellStr,
  283.         PUSHORT   pcb,
  284.         USHORT    usRow,
  285.         USHORT    usColumn,
  286.         HVIO      hvio );
  287.  
  288. USHORT APIENTRY VioWrtCellStr(
  289.         PCH      pchCellStr,
  290.         USHORT   cb,
  291.         USHORT   usRow,
  292.         USHORT   usColumn,
  293.         HVIO     hvio );
  294.  
  295. USHORT APIENTRY VioWrtNAttr(
  296.         PBYTE     pAttr,
  297.         USHORT    cb,
  298.         USHORT    usRow,
  299.         USHORT    usColumn,
  300.         HVIO      hvio );
  301.  
  302.  
  303. USHORT APIENTRY VioWrtNCell(
  304.         PBYTE   pCell,
  305.         USHORT  cb,
  306.         USHORT  usRow,
  307.         USHORT  usColumn,
  308.         HVIO    hvio );
  309.  
  310. #endif
  311.  
  312. #endif
  313.  
  314.  
  315. #ifndef KEYBOARD_ASCII_MODE
  316. #define KEYBOARD_ASCII_MODE 0x0008
  317. #endif
  318.  
  319. #ifndef KEYBOARD_BINARY_MODE
  320. #define KEYBOARD_BINARY_MODE 0x0004
  321. #endif
  322.  
  323. #endif    /* !EMXVIDEO */
  324.